<template>
  <div class="wrapper" ref="wrapper">
    <ul>
      <button @click="btnClick">++</button>
      <li>大撒adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada</li>
      <li>adsasdsada结束</li>
    </ul>
  </div>
</template>

<script>
import BScroll from "better-scroll";

export default {
  data() {
    return {
      scroll: null,
    };
  },
  mounted() {
    this.scroll = new BScroll(this.$refs.wrapper, {
      probeType: 2,
      pullUpLoad: true,
      // scrollbar: true,
      // pullDownRefresh: true,
      // and so on
    });
    this.scroll.on("scroll", (position) => {
      console.log(position);
    });
    this.scroll.on("pullingUp", () => {
      console.log(1);
    });
  },
  methods: {
    btnClick() {
      console.log(1);
    },
  },
};
</script>

<style>
.wrapper {
  height: 150px;
  background-color: pink;
  /* overflow: hidden; */
}
</style>
